<template>
  <div class="content-outer">
    <div
      id="content-head"
      v-loading="infoLoading"
      class="content-head"
    >

      <div class="content-bot">
        <div class="left">
          <div class="avatar-sty">
            <el-image
              :src="infoData.cover"
              lazy
              style="width: 80px;height: 119px;"
            >
              <div
                slot="error"
                style="{imageErrStyle}"
              ><i class="el-icon-picture-outline"></i></div>
            </el-image>
          </div>

        </div>
        <div class="right">
          <div class="info">
            <div
              style="flex:1"
              class="info_name"
            >
              <p class="flex-box flex-center one">
                <span
                  class="titles"
                  :title="infoData.title"
                >{{ infoData.title }}</span>
                <el-tag
                  v-for="item in infoData.tags"
                  :key="item"
                  type="type"
                  size="mini"
                  style="margin-left: 14px;margin-bottom: 0 !important;"
                >{{ item.tag_title }}</el-tag>
              </p>
              <p style="margin-bottom: 8px;">ID:{{ playlet_id }}</p>
              <p>共{{ infoData.chapterList ? infoData.chapterList.length : 0 }}集</p>
              <div class="tags">

              </div>
            </div>
          </div>
        </div>
      </div>
    </div>

    <div class="content-tab">
      <div
        id="top"
        class="flex-box flex-center topbox"
        style="padding:10px 20px"
      >
        <div>
          <ChapterAnalysis :totalnum="infoData.upload_num" />
        </div>

        <!-- 剧集分析 -->

      </div>

    </div>
  </div>
</template>

<script>
import moment from 'moment'
import { formatNumber } from '@/utils/index'
import { playletDetails } from '@/api/content'
import ChapterAnalysis from './component/chapterAnalysis.vue'
export default {
  components: {
    ChapterAnalysis
  },
  data() {
    return {
      playlet_id: '',
      formatNumber: formatNumber,
      infoLoading: false,
      infoData: {},
      showinput: true,
      selectLoading: false,
      searchData: {},
      optionsList: {}
    }
  },
  computed: {},
  mounted() {
    this.playlet_id = this.$route.query.playlet_id
    this.onGetdetails()
  },
  destroyed() {},
  methods: {
    async onGetdetails() {
      const res = await playletDetails({ id: this.playlet_id })
      if (res.status_code === 1) {
        this.infoData = res.data
      }
    },
    contractPlayletSearchAsync() {},
    changeAppName() {},
    showInput() {},
    saveCollection() {}
  }
}
</script>

<style lang="scss">
.timelinesty {
  .el-timeline {
    margin: 0;
    padding: 0;
    height: 200px;
    overflow-y: auto;
    .el-timeline-item__node--normal {
      width: 10px;
      height: 10px;
      left: 0;
    }

    .el-timeline-item__content {
      color: #333333;
      font-weight: 500;
    }
    .el-timeline-item__timestamp {
      font-size: 12px;
    }
    .el-timeline-item__timestamp.is-bottom {
      margin-top: 5px;
    }
  }
}
</style>

<style lang="scss" scoped>
.content-outer {
  font-size: 14px;
  color: #333333;

  .search-label {
    color: #999999;
  }
  .dateview {
    min-width: 0 !important;
    width: 250px;
  }

  .content-head {
    background: #fff;
    padding: 20px;

    p {
      margin: 0;
      padding: 0;
    }
    .search-form > .search-item {
      background: #ffeddb;
      border-radius: 4px;
      padding: 6px 8px;
    }
    .search-form > .search-item:first-child {
      margin-right: 20px;
    }

    .content-bot {
      display: flex;
      flex-direction: row;

      .left {
        display: flex;
        flex-direction: row;
        flex: 0 0 auto;
        .avatar-sty {
          margin-right: 20px;
        }
        .one {
          // display: grid;
          // width: 100%;
          // grid-template-columns: minmax(0px, 1fr) 35px 35px 47px 50px;
          margin-bottom: 10px;
          svg {
            margin-left: 17px;
          }

          .iconsty {
            width: 16px;
            height: 16px;
          }
        }

        .titles {
          font-size: 24px;
          color: #333;
          font-weight: 500;
          line-height: 33px;
          overflow: hidden;
          text-overflow: ellipsis;
          max-width: 200px !important;
          white-space: nowrap;
        }
      }

      .right {
        width: calc(100% - 200px);
        flex: 1;
        .info {
          display: flex;
          margin-bottom: 0px;
          background-color: #fff !important;

          .one {
            margin-top: 10px;
            margin-bottom: 10px;
            display: flex;
            align-items: center;
          }

          .info_name {
            width: calc(100% - 110px);
            .tags {
              display: flex;
              align-items: center;
              margin-top: 18px;
            }
          }

          .titles {
            font-size: 24px;
            color: #333;
            font-weight: 500;
            line-height: 33px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            max-width: calc(100% - 250px);
            display: inline-block;
          }

          .action {
            flex: 0 0 auto;
            display: flex;
          }
        }
        .el-input {
          width: 230px;
        }
        .iconsty {
          width: 30px;
          height: 30px;
          margin-left: 20px;
          cursor: pointer;
        }
      }
    }

    .head-card {
      display: grid;
      grid-template-columns: minmax(100px, 0.8fr) minmax(100px, 1.2fr) minmax(100px, 1.2fr) minmax(100px, 1fr) minmax(100px, 0.8fr);
      .head-card-item {
        // width: 24.99%;
        padding: 0 10px 0 20px;
        border-left: 1px solid #f1f5fd;

        .parentSty {
          overflow: hidden;
          .search-label {
            margin-bottom: 12px;
          }
        }
        .iconsty {
          width: 30px;
          height: 30px;
          margin-left: 0;
          margin-right: 12px;
        }
      }
      .head-card-item:nth-child(1) {
        padding: 0;
        border: none;
      }

      .pstys {
        // width: calc(100% / 4 - 6px);
        margin-top: 12px;
        font-size: 28px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-weight: 500;
        line-height: 36px;
      }
    }

    ::v-deep.el-divider {
      margin: 20px 0;
      background-color: #f1f5fd;
    }
  }
  //  吸顶样式tab
  .content-tab {
    background: #f6faf8;

    .topbox {
      justify-content: center;
    }

    .left {
      .search-label {
        font-size: 14px;
        font-weight: 400;
        color: #333333;
        line-height: 20px;
      }
      .search-label + .search-label {
        margin-left: 20px;
      }
      .avatar-sty {
        margin-right: 10px;
        flex: 0 0 auto;
        height: 75px;
      }
      .one {
        margin-bottom: 10px;
        margin-top: 5px;
        svg {
          margin-left: 17px;
        }
        .iconsty {
          width: 16px;
          height: 16px;
        }
      }
      .left_names {
        width: calc(100% - 60px);
      }
      .titles {
        font-size: 24px;
        color: #06c261;
        font-weight: 500;
        line-height: 33px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: calc(100% - 165px);
        display: inline-block;
      }
    }
    .tabs {
      display: inline-block;
      text-align: center;
      flex: 0 0 auto;
      // button {
      //   width: 80px;
      // }

      button:last-child {
        margin-left: 0;
      }
    }
    p {
      margin: 0;
      padding: 0;
    }

    .costtabs {
      padding: 20px;
    }

    // .leftinfo {
    //   .titles {
    //     font-size: 24px;
    //     color: #333;
    //     font-weight: 500;
    //     line-height: 33px;
    //     white-space: nowrap;
    //     overflow: hidden;
    //     text-overflow: ellipsis;
    //     max-width: 200px;
    //     display: inline-block;
    //   }
    // }
  }

  ::v-deep .el-dialog__wrapper {
    .el-dialog__header {
      padding: 20px;
    }

    .el-dialog__title {
      font-size: 16px;
      font-weight: 500;
    }
    .el-dialog__body {
      border-top: 1px solid #f0f0f0;
      padding: 0;

      .el-form {
        padding: 20px 0;
      }
      // .el-form-item {
      //   margin-bottom: 0;
      // }
      .form-item-sty {
        padding: 0 20px;
      }

      .modalbtn {
        margin-top: 20px;
        padding: 20px 20px 0;
        border-top: 1px solid #f0f0f0;
        margin-bottom: 0;

        .el-form-item__content {
          text-align: right;
        }
      }
      .search-item {
        display: flex;
        flex-direction: row;
        align-items: center;
        margin-bottom: 20px;
        .item-label {
          width: 80px;
          text-align: right;
          margin-right: 10px;
          color: #333333;
        }
      }
    }
  }
}

.app-container + .app-container {
  margin-top: 10px;
}
.chart-container {
  font-size: 14px;
  background: #fff;
  // margin-bottom: 20px;
  &::after {
    content: ' ';
    display: block;
    height: 0;
    clear: both;
    visibility: hidden;
  }
  .chart-title {
    font-size: 16px;
    font-weight: 500;
    // height: 16px;
    color: #333333;
    // margin-bottom: 20px;
    margin-left: 20px;
    display: flex;
    // width: 100%;
    align-items: center;
  }
  color: #333333;
  .chart-item {
    width: 50%;
    padding: 15px;
    float: left;
    min-height: 200px;
    .item-box {
    }
  }

  .search-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    margin-bottom: 20px;
    .item-label {
      width: 80px;
      text-align: right;
      margin-right: 10px;
    }
  }
}

::v-deep.selectmultipleSty {
  .el-select__tags {
    // max-width: 110px !important;
    > span {
      display: flex;
      flex-direction: row;
      > span:first-child {
        max-width: 120px;
      }
    }
    .el-select__input {
      // margin-left: 5px;
      // width: 30px !important;
      // max-width: 30px !important;
    }
  }

  .el-input__inner {
    height: 32px;
  }
}
</style>

